<template>
  <view>
    <view>
      mapState：{{age}}
    </view>
  </view>
</template>

<script lang="ts">
import Vue from 'vue'
import { mapState } from 'vuex'//引入mapState
export default Vue.extend({
  computed: mapState([
    'username',//映射 this.username 为 store.state.username
    'age',
  ])
})
</script>

<style scoped>

</style>
